package com.example.peanutsubway.web;

import com.alibaba.fastjson.JSONObject;
import com.example.peanutsubway.annotation.ResponseTypeAnnotation;
import com.example.peanutsubway.service.AdminUserService;
import com.example.peanutsubway.service.abst.AdminUserServiceAbst;
import com.example.peanutsubway.service.impl.AdminUserServiceImpl;
import com.example.peanutsubway.util.PageInfo;
import com.example.peanutsubway.vo.UserInfo;

import javax.servlet.annotation.WebServlet;
import java.util.List;

/**
 * @Author：zzt
 * @Version：1.0
 * @Date：2021/10/13-16:31
 * @Since:jdk1.8
 * @Description:
 */
@WebServlet("/superSu.do")
public class SuperSUServlet extends BaseServlet<UserInfo>{
    private AdminUserService  adminUserService = new AdminUserServiceImpl();
    @ResponseTypeAnnotation
    public String showUser(){
        String nowPage = request.getParameter("page");
        String pageNum = request.getParameter("pageSize");
        PageInfo pageInfo = adminUserService.findAllUser(nowPage, pageNum);
        return JSONObject.toJSONString(pageInfo);
    }

    public String showRole(){
        return JSONObject.toJSONString(adminUserService.findAllRole());
    }


}
